Repository navigation
fix(fleet-queue): broker transports — auth before body, reject oversized/incomplete, timeouts (#6515) - #8085
Conversation
…zed/incomplete, timeouts (#6515)
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 13 seconds. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Codex review note (task 11464, lane code-v): the Codex code review on this PR failed to run — the summary comment (6755602426) states "We couldn't complete this review" and a follow-up Codex comment confirms the account's Codex usage limits for code reviews are reached. The review produced no findings (no inline Codex comments exist on this PR), so there is nothing undispositioned under the Codex-findings gate; the |
Fixes #6515 — follow-up to PR #6514: dispositions all 11 CodeRabbit review threads on the fleet brokers' dual-bind transports.
What changed
pre_body_refusalgate in both brokers, applied on TCP (tiny_http loop) and UDS (uds_http::serve_with_precheck) — an unauthorized or oversized request is refused from its headers alone (401 / 413) before a single body byte is read. Body reads are capped at 16 MiB (cap+1 detects undeclared overruns).uds_http::serve..bind-lockfile (4492609657); the live-owner probe is bounded to 2s and a timeout reads as "live" (4492609644); non-socket files at the socket path are preserved and the bind refused (4492609635); parent-dir chmod only for directories this call created (4492609622); socket chmod failure now fails the bind instead of being ignored (4492609673).Documented decision — TCP read timeout
tiny_http 0.12 exposes no per-connection read timeout, so the TCP loops cannot set one. Residual slow-body risk on TCP is bounded by the auth-first gate, the 16 MiB cap, and thread-per-connection isolation; the UDS transport carries real 30s timeouts. Recorded on #6515 per its acceptance criteria.
Tests (oracle-named)
cargo test -p fleet-queue --features queue-broker,secrets-broker,client— 129 lib tests + 2 bin-args tests pass.pre_body_refusal_decides_from_headers_alone(both brokers),precheck_refuses_before_the_body_is_consumed(a 401 arrives although the declared body is never sent),oversized_content_length_is_rejected_before_the_handler,incomplete_body_is_rejected_before_the_handler,chunked_transfer_encoding_is_rejected_before_the_handler,non_socket_file_is_preserved_and_bind_refused. All rejected-shape oracles: no response / refusal, handler invoked zero times.git diff --checkclean. Touched files rustfmt-formatted.Queue: task 11464 (repo-health-code-pilot), lane code-v.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.